using System;
public static class ExObject
{
    public static int ToInt(this object ob)
    {
        if (ob is int) return (int)ob;
        if (ob is float) return (int)(float)ob;
        if (ob is double) return (int)(double)ob;
        if (ob is Single) return (int)(float)(Single)ob;
        return 0;
    }
}